import axios from "axios"
//异步函数分发器actions
export default {
    async axiosList({
        commit
    }) {
        const reslut = await axios.get("https://pcw-api.iqiyi.com/search/recommend/list?channel_id=1&data_type=1&mode=11&page_id=2&ret_num=48&session=b9fd987164f6aa47fad266f57dffaa6a")
        commit("getMovieList", reslut.data.data.list)
    },
    //按照需求获取请求数据
    async axiosListN({
        commit
    }, {
        n,
        m
    }) {
        console.log(n, m);
        const reslut = await axios.get("https://pcw-api.iqiyi.com/search/recommend/list?channel_id=1&data_type=1&mode=11&page_id=2&ret_num=48&session=b9fd987164f6aa47fad266f57dffaa6a")
        const newreslut = reslut.data.data.list.filter(item => {
            return item.name.length >= n && item.name.length <= m
        })
        commit("filterMovieLsit", newreslut)
    },

}